import { Column, Entity, Index } from 'typeorm';
import { IBaseEntity } from '../../00_base/IBaseEntity';

@Index('PK__sys_menu__3213E83FDF519858', ['id'], { unique: true })
@Entity('sys_menu', { schema: 'dbo' })
export class SysMenu extends IBaseEntity {
  @Column('bigint', { name: 'parent_id', nullable: false })
  parentId: number;

  @Column('nvarchar', { name: 'tree_path', nullable: true, length: 255 })
  treePath: string | null;

  @Column('nvarchar', { name: 'name', length: 64 })
  name: string;

  @Column('nvarchar', { name: 'type', nullable: true, length: 255 })
  type: string;

  @Column('nvarchar', { name: 'path', nullable: true, length: 128 })
  path: string | null;

  @Column('nvarchar', { name: 'component', nullable: true, length: 128 })
  component: string | null;

  @Column('nvarchar', { name: 'perm', nullable: true, length: 128 })
  perm: string | null;

  @Column('tinyint', { name: 'visible' })
  visible: number;

  @Column('int', { name: 'sort', nullable: true })
  sort: number | null;

  @Column('nvarchar', { name: 'icon', nullable: true, length: 64 })
  icon: string | null;

  @Column('nvarchar', { name: 'redirect', nullable: true, length: 128 })
  redirect: string | null;

  @Column('tinyint', { name: 'always_show', nullable: true })
  alwaysShow: number | null;

  @Column('tinyint', { name: 'keep_alive', nullable: true })
  keepAlive: number | null;
}
